
var math = {
  
  distance: function(x1, y1, x2, y2) {
    var xsq = (x2 - x1);
    var ysq = (y2 - y1);  
    xsq *= xsq;
    ysq *= ysq;      
    return Math.sqrt(xsq + ysq);
  },
  
  angle: function(x1, y1, x2, y2) {
    return Math.atan((y2 - y1) / (x2 - x1));
  }
  
};